package com.laivi.basic.module.crawler;

import com.laivi.basic.model.crawler.LinkFilter;

public abstract class AParser implements Parsers {

	protected LinkFilter linkFilter;
	
	protected LinkFilter parserLinkFilter;
	
	protected String[] seeds;
	
	protected static int parserNum;
	
	protected String key;
	
	protected int max;
	
	public AParser(){
	}
	
	public AParser(LinkFilter linkFilter, LinkFilter parserLinkFilter,
			String[] seeds) {
		this.linkFilter = linkFilter;
		this.parserLinkFilter = parserLinkFilter;
		this.seeds = seeds;
	}

	@Override
	public LinkFilter getLinkFilter() {
		return this.linkFilter;
	}

	@Override
	public String[] getSeeds() {
		return this.seeds;
	}

	@Override
	public LinkFilter getParserLinkFilter() {
		return this.parserLinkFilter;
	}

	public void setLinkFilter(LinkFilter linkFilter) {
		this.linkFilter = linkFilter;
	}

	public void setParserLinkFilter(LinkFilter parserLinkFilter) {
		this.parserLinkFilter = parserLinkFilter;
	}

	public void setSeeds(String[] seeds) {
		this.seeds = seeds;
	}
	
	@Override
	public synchronized void addParserNum() {
		parserNum++;
	}

	@Override
	public int getParserNum() {
		return parserNum;
	}

	
	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public int getMax() {
		return max;
	}

	public void setMax(int max) {
		this.max = max;
	}
}
